Integrate Hermes CDPDebugAPI with RN console polyfill#43454
Closed
motiz88 wants to merge 2 commits into
Closed
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D54494298 |
Base commit: 4f10f30 |
Differential Revision: D54846939
Summary: Changelog: [Internal] 1. Introduces the `RuntimeTargetDelegate::addConsoleMessage` method, which is a 1:1 wrapper around the Hermes `CDPDebugAPI` [method of the same name](https://github.com/facebook/hermes/blob/33cf8cfe781aabcad6b3d39821d815fe5317f977/API/hermes/cdp/CDPDebugAPI.h#L43-L47). 2. Installs a global `__inspectorLog` function callable from JS, matching [this existing call](https://github.com/facebook/react-native/blob/4f10f3069fff9090d700d9bcfbf49da1aa85f272/packages/polyfills/console.js#L430-L437) in React Native's `console` polyfill. NOTE: We'll almost immediately replace `__inspectorLog` with a standalone native implementation of the `console` API that doesn't depend on the polyfill, but this is an easy way to validate the approach before tackling the full `console` spec, which requires some more C++ code and boilerplate. Differential Revision: D54494298
af29811 to
a28f404
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D54494298 |
motiz88
added a commit
to motiz88/react-native
that referenced
this pull request
Mar 13, 2024
Summary: Changelog: [Internal] 1. Introduces the `RuntimeTargetDelegate::addConsoleMessage` method, which is a 1:1 wrapper around the Hermes `CDPDebugAPI` [method of the same name](https://github.com/facebook/hermes/blob/33cf8cfe781aabcad6b3d39821d815fe5317f977/API/hermes/cdp/CDPDebugAPI.h#L43-L47). 2. Installs a global `__inspectorLog` function callable from JS, matching [this existing call](https://github.com/facebook/react-native/blob/4f10f3069fff9090d700d9bcfbf49da1aa85f272/packages/polyfills/console.js#L430-L437) in React Native's `console` polyfill. NOTE: We'll almost immediately replace `__inspectorLog` with a standalone native implementation of the `console` API that doesn't depend on the polyfill, but this is an easy way to validate the approach before tackling the full `console` spec, which requires some more C++ code and boilerplate. Reviewed By: huntie Differential Revision: D54494298
Contributor
|
This pull request has been merged in 51e0b3a. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Changelog: [Internal]
RuntimeTargetDelegate::addConsoleMessagemethod, which is a 1:1 wrapper around the HermesCDPDebugAPImethod of the same name.__inspectorLogfunction callable from JS, matching this existing call in React Native'sconsolepolyfill.NOTE: We'll almost immediately replace
__inspectorLogwith a standalone native implementation of theconsoleAPI that doesn't depend on the polyfill, but this is an easy way to validate the approach before tackling the fullconsolespec, which requires some more C++ code and boilerplate.Differential Revision: D54494298